import neu.soft.entity.NormalOrder;
import neu.soft.entity.NormalOrderInfo;
import neu.soft.service.OrderService;
import neu.soft.service.SenderService;
import neu.soft.vo.MsgBean;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class testmsg {
    @Autowired
    SenderService service;


    @Test
    public void testMsg(){
        System.out.println(service.sendMoney(new MsgBean<>(1,"hahahah")));
    }


@Autowired
    private OrderService orderService; // 假设存在一个OrderService类

    @Test
    public void testFindAllOrder() {
        List<NormalOrder> orders = orderService.findAllOrder();
        // 进行断言，验证返回结果是否符合预期
        Assertions.assertNotNull(orders);
        Assertions.assertEquals(10, orders.size()); // 假设预期结果是10个订单
        // 可以进一步验证订单的属性值等
    }

    @Test
    public void testFindUserOrder() {
        Map<String,Object>map = new HashMap<>();
        map.put("uid","54daf6ds7f89ae78df754s5df45");
        List<NormalOrder> userOrders = orderService.findUserOrder(map);
        // 进行断言，验证返回结果是否符合预期
        Assertions.assertNotNull(userOrders);
        Assertions.assertEquals(5, userOrders.size()); // 假设预期结果是用户的订单数量为5
        // 可以进一步验证订单的属性值等
    }


}
